<template>
<div class="zx">
  <avue-form ref="form" v-model="obj" :option="option" @reset-change="emptytChange" @submit="submit">

  </avue-form>

</div>
</template>

<script>
import tableMixins from "@/mixins/tableMixin.vue"
export default {
  name: "userCenter",
  mixins: [tableMixins],
  data(){
    return{
      obj:{},
      adminId:"",
      option:{
        column:[
          {
          label: "账号",
          prop: "adminAccount",
          disabled:true,
          mock:{
            type:'name'
          },
          span:24
        },
          {
            label: "姓名",
            prop: "adminRealName",
            mock:{
              type:'name'
            },
            span:24
          },
          {
            label: "手机号",
            prop: "phone",
            type: "number",
            mock:{
              type:'name'
            },
            span:24
          },
          {
            label: "部门",
            prop: "deptNames",
            disabled:true,
            mock:{
              type:'name'
            },
            span:24
          },          {
            label: "角色",
            prop: "groupRoleNames",
            disabled:true,
            mock:{
              type:'name'
            },
            span:24
          },
          {
            label: '水印头像',
            prop: 'adminHeadImage',
            type: 'upload',
            multiple: true,
            listType: 'picture-img',
            span: 24,
            propsHttp: {
              url: 'result'
            },
            tip: '只能上传jpg/png用户头像，且不超过500kb',
            action: '/yuanjiu/upload/uploadImg'
          }]
      }
    }
  },
  created() {
    this.adminId = localStorage.getItem('yj_adminId');

  },
  mounted() {
    this.getUser()
  },
  methods:{
    getUser(){
      this.$httpService.get("/yuanjiu.testnew/yj-admin/getYjAdminById?yj_adminId="+this.adminId).then(res => {
        this.obj=res
      })

    },
    emptytChange(){

    },
    submit(form,done){
      this.$httpService.post("/yuanjiu.testnew/yj-admin/insertOrUpdate",this.obj).then(res => {
        this.$message.success('修改成功')
        done()

      })
    }
  }
}
</script>

<style scoped>
 .zx{
   width: 30%;
   margin: 0 auto;
   margin-top: 100px;
 }
</style>
